home *** CD-ROM | disk | FTP | other *** search
-
- #include <stdio.h>
- #include <exec/memory.h>
- #include <dos/dos.h>
- #include <intuition/intuition.h>
- #include <clib/exec_protos.h>
- #include <clib/intuition_protos.h>
-
-
- #define INTUINAME (UBYTE *)"intuition.library"
- #define VERSION 37
- #define MAXLEN 80
- #define TEXT (UBYTE *)"Detta är en text skriven via AmigaDOS...\nI ett Intuition-fönster"
- #define ERRTEXT (UBYTE *)"Hmm, du kör inte AmigaOS 2.0 va?\n"
-
- struct IntuitionBase *IntuitionBase;
-
-
- int main(void)
- {
- struct Window *win;
- char conName[MAXLEN];
- BPTR fh;
-
-
- IntuitionBase = (struct IntuitionBase *)OpenLibrary(INTUINAME,VERSION);
- if(IntuitionBase) {
- win = OpenWindowTags(NULL,
- WA_Left,10,
- WA_Top, 10,
- WA_Width, 400,
- WA_Height, 100,
- WA_DragBar,TRUE,
- WA_DepthGadget,TRUE,
- WA_SimpleRefresh,TRUE,
- TAG_DONE);
- if(win) {
- sprintf(conName,"CON://///Footitel/WINDOW%lx",win);
- fh = Open(conName,MODE_OLDFILE);
- if(fh) {
- Write(fh,TEXT,strlen(TEXT));
- Delay(150);
- Close(fh);
- }
- else
- CloseWindow(win);
- }
- CloseLibrary((struct Library *)IntuitionBase);
- }
- else
- Write(Output(),ERRTEXT,strlen(ERRTEXT));
- }